package com.tongji.showroom.command
{
	import com.tongji.showroom.events.GetUserSceneEvent;
	import com.tongji.showroom.model.UserSceneModel;
	import com.tongji.showroom.service.UserSceneService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 *
	 * @author caddy
	 * @date 2011-11-15
	 */
	public class GetUserSceneCommand extends Command
	{
		[Inject]
		public var event:GetUserSceneEvent;
		
		[Inject]
		public var service:UserSceneService;
		
		[Inject]
		public var model:UserSceneModel;
		
		override public function execute():void
		{
			switch (event.type)
			{
				case GetUserSceneEvent.GET_USER_SCENE:
					service.getUserScene(event.userID, event.state, event.currentPage, event.pageSize);
					break;
				case GetUserSceneEvent.UPDATE_USER_SCENE:
					model.updateUserScene(event.userScene);
					break;
			}
		}
	}
}